package cn.support.neo.mvp.model;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.github.pwittchen.prefser.library.Prefser;

import cn.support.neo.mvp.api.CommonAPI;
import cn.support.neo.mvp.core.base.BaseModel;
import cn.support.neo.mvp.core.provider.TokenProvider;
import cn.support.neo.mvp.core.service.client.HttpClient;
import cn.support.neo.mvp.model.entity.base.BaseEntity;
import cn.support.neo.mvp.model.entity.base.DataPattern;
import rx.Observable;


/**
 * Name:公共API数据模型
 * Author: WK（wangkun@xjzhicheng.com)
 * Date: 2016-06-22
 * Describe: 公共数据，学校，验证码
 */
public class CommonModel extends BaseModel<CommonAPI, CommonModel> {

    public CommonModel(@NonNull Context context,
                       @NonNull HttpClient httpClient,
                       @Nullable TokenProvider tokenProvider,
                       @NonNull Prefser prefser) {
        super(context, httpClient, tokenProvider, prefser);
    }

    @Override
    protected Class<CommonAPI> getServiceClass() {
        return CommonAPI.class;
    }


    /**
     * 获得注册验证码
     */
    public Observable<DataPattern> getVC(String phone) {
        return getService().getVC(phone);
    }


    /**
     * 退出
     */
    public Observable<BaseEntity> postLogOut() {
        return getService().postLogOut();
    }


}
